#include <unistd.h>
#include <arpa/inet.h>

#include "Constant.h"
#include "NetworkTools.h"

#include <queue>
#include <string>
#include <cstdio>
#include <cstring>

using namespace std;

struct ConnectInfo {
    int client_fd;

    struct sockaddr_in server_address;

    ConnectInfo() = default;

    ConnectInfo(int client_fd, const sockaddr_in &server_address) : client_fd(client_fd),
                                                                    server_address(server_address) {}
};

class Client {
public:
    virtual ~Client();

public:
    static ConnectInfo *info;

    static bool is_end_work_thread;

public:
    static void startClient();

    static void endClient();

    static string sendMessageToSever(const string& message);

private:
    static ConnectInfo *connectSever();
};